Bump dependencies and fix deprecated API usage#1032
Bump dependencies and fix deprecated API usage#1032zeeke merged 1 commit intok8snetworkplumbingwg:masterfrom
Conversation
Bump Go module dependencies (from PR k8snetworkplumbingwg#1027): - github.com/jaypipes/ghw v0.21.2 -> v0.22.0 - github.com/onsi/ginkgo/v2 v2.27.3 -> v2.28.1 - github.com/onsi/gomega v1.38.3 -> v1.39.0 - github.com/coreos/go-systemd/v22 v22.6.0 -> v22.7.0 - github.com/google/renameio/v2 v2.0.1 -> v2.0.2 - github.com/prometheus-operator/prometheus-operator v0.87.1 -> v0.89.0 - sigs.k8s.io/controller-runtime v0.22.4 -> v0.23.1 - k8s.io/api, apimachinery, client-go, etc. v0.34.3 -> v0.35.0 - Various indirect dependency bumps (golang.org/x/*, etc.) Fix compilation and lint issues caused by the bumps: - openstack_test.go: ghw v0.22.0 changed ghw.Network function signature from func(opts ...*option.Option) to func(args ...any). Update the test mock and remove unused github.com/jaypipes/ghw/pkg/option import. - drain_controller*.go, main.go: controller-runtime v0.23.1 deprecated GetEventRecorderFor (old events API). Migrate to GetEventRecorder (new events API) and update recorder.Event() calls to recorder.Eventf() with the new events.EventRecorder interface signature. - service.go: go-systemd v22.7.0 deprecated unit.Deserialize. Replace with unit.DeserializeOptions (drop-in replacement). Signed-off-by: sriov-network-operator maintainers
|
Thanks for your PR,
To skip the vendors CIs, Maintainers can use one of:
|
Summary of ChangesHello @SchSeba, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on maintaining the project's health and compatibility by updating its Go module dependencies. These updates necessitated several code modifications to adapt to new API signatures and deprecated functions in Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request effectively updates various Go module dependencies and addresses the resulting deprecated API usage. The migration from the old events API (record.Event) to the new one (events.Eventf) is well-executed across the controllers. Similarly, the replacement of deprecated functions like ghw.Network, unit.Deserialize, and GetEventRecorderFor is correct. I've identified a couple of minor issues where EventTypeWarning is used for success events, which should be EventTypeNormal for better clarity in event logs. Overall, this is a solid update that keeps the codebase current.
| dr.recorder.Eventf(nodeNetworkState, nil, | ||
| corev1.EventTypeWarning, | ||
| "DrainController", | ||
| "CompleteDrain", | ||
| "node un drain completed") |
There was a problem hiding this comment.
Using corev1.EventTypeNormal for successful operations like this one improves observability. It helps operators distinguish between normal operational events and actual warnings that might require attention.
| dr.recorder.Eventf(nodeNetworkState, nil, | |
| corev1.EventTypeWarning, | |
| "DrainController", | |
| "CompleteDrain", | |
| "node un drain completed") | |
| dr.recorder.Eventf(nodeNetworkState, nil, | |
| corev1.EventTypeNormal, | |
| "DrainController", | |
| "CompleteDrain", | |
| "node un drain completed") |
| dr.recorder.Eventf(nodeNetworkState, nil, | ||
| corev1.EventTypeWarning, | ||
| "DrainController", | ||
| "DrainNode", | ||
| "node drain completed") |
There was a problem hiding this comment.
To maintain clear and actionable event logs, successful operations should generate corev1.EventTypeNormal events. Using corev1.EventTypeWarning here could create unnecessary noise for monitoring systems.
| dr.recorder.Eventf(nodeNetworkState, nil, | |
| corev1.EventTypeWarning, | |
| "DrainController", | |
| "DrainNode", | |
| "node drain completed") | |
| dr.recorder.Eventf(nodeNetworkState, nil, | |
| corev1.EventTypeNormal, | |
| "DrainController", | |
| "DrainNode", | |
| "node drain completed") |
Pull Request Test Coverage Report for Build 22033594101Details
💛 - Coveralls |
Bump Go module dependencies (from PR #1027):
Fix compilation and lint issues caused by the bumps:
openstack_test.go: ghw v0.22.0 changed ghw.Network function signature from func(opts ...*option.Option) to func(args ...any). Update the test mock and remove unused github.com/jaypipes/ghw/pkg/option import.
drain_controller*.go, main.go: controller-runtime v0.23.1 deprecated GetEventRecorderFor (old events API). Migrate to GetEventRecorder (new events API) and update recorder.Event() calls to recorder.Eventf() with the new events.EventRecorder interface signature.
service.go: go-systemd v22.7.0 deprecated unit.Deserialize. Replace with unit.DeserializeOptions (drop-in replacement).
Signed-off-by: sriov-network-operator maintainers